'use client';
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import Container from '@mui/material/Container';
import Link from '@mui/material/Link';

function Copyright() {
  return (
    <Typography variant="body2" color="text.secondary" align="center">
      {'Copyright © '}
      <Link color="inherit" href="http://panzhiyao.cn/">
        Panzhiyao
      </Link>
      &nbsp;{new Date().getFullYear()}
      {'.'}
    </Typography>
  );
}

export default function Footer() {
  return (
    <Box
      component="footer"
      sx={{
        py: 1,
        px: 2,
        mt: 'auto',
        backgroundColor: (theme) =>
          theme.palette.mode === 'light'
            ? theme.palette.grey[200]
            : theme.palette.grey[800],
      }}
    >
      <Container maxWidth="lg">
        <Typography variant="h6" align="center">
          Designed & Powerd by panzhengtao
        </Typography>
        <Box
          sx={{
            display: 'flex',
            flexWrap: 'wrap',
            justifyContent: 'center',
            typography: 'body1',
            '& > :not(style) ~ :not(style)': {
              ml: 2,
            },
          }}
        >
          <Link
            color="inherit"
            href="https://beian.miit.gov.cn/#/Integrated/index"
            target="_blank"
            variant="body1"
            underline="none"
            className="text-sm"
          >
            粤ICP备 2021100646号-2
          </Link>
          <Link
            color="inherit"
            href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44030602006071"
            target="_blank"
            variant="body1"
            underline="none"
            className="text-sm"
          >
            <img
              src="https://www.gdzwfw.gov.cn/portal/index-assets/img/beian.e6f2938.png"
              alt="粤公网安备 44030602006071号"
              className="inline-block align-middle"
            />
            <span className="inline-block align-middle">粤公网安备</span>
          </Link>
        </Box>

        <Copyright />
      </Container>
    </Box>
  );
}
